package de.fhtrier.gdw2.ships.game;

import java.util.ArrayList;

import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.state.StateBasedGame;

import de.fhtrier.gdw2.ships.game.entities.Entity;
import de.fhtrier.gdw2.ships.game.interfaces.ISelecteable;

public class Contextmenue
	{
		private ArrayList<ISelecteable> selectedEntities;

		
		public Contextmenue(World world)
			{
				selectedEntities = world.getSelected();
			}

		public void render(GameContainer container, StateBasedGame game,
				Graphics g, World world)
			{
				//Menü undurchsichtig machen...
				g.setColor(new Color(0x000000));
				g.fillRect(10, 10, 1530, 80);
				g.setColor(new Color(0xFFFFFF));
				//extremst stylischer weißer Rand...
				g.drawRect(10, 10, 1530, 80);
				
				g.drawString("Menue_Title", 20, 20);
				
				this.selectedEntities = world.getSelected();
				if(!selectedEntities.isEmpty())
					{
						Entity shown = (Entity) selectedEntities.get(0);
						
						g.drawString(shown.getTypeName(), 210, 20);
						g.drawString("Markiere Einheiten: " + selectedEntities.size(), 410, 20);
						g.drawString("Direction: " + shown.getDirection(), 610, 20);
						
						
						//g.drawString("Target-x: " + shown.getTarget().getX() + "Target-y: " + shown.getTarget().getY(), 620, 60);
						
					}
				g.drawString("Position X/Y: " + world.getOffsetX() + " " + world.getOffsetY() , 810, 20);
				

				
			}

		public void update()
			{
				
			}


	}
